//
// Created by LONG on 2020/10/17.
//

#ifndef O5G_SRC_CCORE_INCLUDE_O5G3GPPCONV_H_
#define O5G_SRC_CCORE_INCLUDE_O5G3GPPCONV_H_

#include <OCTET_STRING.h>
#include <BIT_STRING.h>
#include <NGAP_GNB-ID.h>
#include "o5g3gppTypes.h"
#include "o5gConv.h"

#ifdef __cplusplus
extern "C"
{
#endif

void ogs_asn_uint8_to_OCTET_STRING(
    uint8_t uint8, OCTET_STRING_t *octet_string);
void ogs_asn_uint16_to_OCTET_STRING(
    uint16_t uint16, OCTET_STRING_t *octet_string);
void ogs_asn_uint24_to_OCTET_STRING(
    uint24_t uint24, OCTET_STRING_t *octet_string);
void ogs_asn_uint32_to_OCTET_STRING(
    uint32_t uint32, OCTET_STRING_t *octet_string);

void ogs_asn_OCTET_STRING_to_uint8(
    OCTET_STRING_t *octet_string, uint8_t *uint8);
void ogs_asn_OCTET_STRING_to_uint16(
    OCTET_STRING_t *octet_string, uint16_t *uint16);
void ogs_asn_OCTET_STRING_to_uint24(
    OCTET_STRING_t *octet_string, uint24_t *uint24);
void ogs_asn_OCTET_STRING_to_uint32(
    OCTET_STRING_t *octet_string, uint32_t *uint32);

void ogs_asn_buffer_to_OCTET_STRING(
    void *buf, int size, OCTET_STRING_t *octet_string);

void ogs_asn_buffer_to_BIT_STRING(
    void *buf, int size, int unused, BIT_STRING_t *bit_string);
void ogs_asn_uint32_to_BIT_STRING(
    uint32_t uint32, uint8_t bitsize, BIT_STRING_t *bit_string);
void ogs_asn_BIT_STRING_to_uint32(BIT_STRING_t *bit_string, uint32_t *uint32);

int ogs_asn_BIT_STRING_to_ip(
    BIT_STRING_t *bit_string, S_O5gIp *ip);
int ogs_asn_ip_to_BIT_STRING(
    S_O5gIp *ip, BIT_STRING_t *bit_string);

void ogs_ngap_uint32_to_GNB_ID(uint32_t gnb_id, uint8_t bitsize, NGAP_GNB_ID_t *gNB_ID);

#ifdef __cplusplus
}
#endif

#endif //O5G_SRC_CCORE_INCLUDE_O5G3GPPCONV_H_
